﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;

namespace AnyOffice.general.attend.manage
{
    public partial class leave_destroy : ModulePage
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                int num = (Request.QueryString["leave_id"] != null) ? int.Parse(Request.QueryString["leave_id"].ToString()) : 0;
                this.ViewState["LeaveId"] = num;
                this.txtDestroyTime.Value = DateTime.Now.ToString();
            }
            if (this.Page.IsPostBack)
            {
                int leaveId = Convert.ToInt32(this.ViewState["LeaveId"].ToString());
                new AttendLeaveDao().Destroy(base.Conn, leaveId, Convert.ToDateTime(this.txtDestroyTime.Value));
                this.pnlMain.Visible = false;
                this.litMessage.Text = base.ShowPromptClose("操作成功！") + "\n<script>\nopener.location.reload();\nself.close();\n</script>\n";
            }
        }
 

    }
}
